package com.ck.ips.service.impl.program;

import com.ck.common.model.ProgramSource;
import com.ck.ips.dao.program.ProgramSourceMapper;
import com.ck.ips.model.vo.program.ProgramReducedSourceListVO;
import com.ck.ips.service.program.ProgramSourceService;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author linqiang
 * @version v1.0
 * @Description
 * @date 2019-04-29 16:59
 */
@Service(value = "programSourceService")
public class ProgramSourceServiceImpl implements ProgramSourceService {

    @Autowired
    private ProgramSourceMapper programSourceMapper;


    /**
     * 批量新增
     *
     * @param programSourceList
     * @return 影响行数
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public int batchInsert(List<ProgramSource> programSourceList) {
        return programSourceMapper.batchInsert(programSourceList);
    }

    /**
     * 根据节目版本号查询素材
     *
     * @param programVersion 节目版本号
     * @return 素材集合
     */
    @Override
    public List<ProgramSource> listByProgramVersion(String programVersion) {
        return programSourceMapper.listByProgramVersion(programVersion);
    }

    /**
     * 批量删除
     *
     * @param programVersion 节目版本号
     * @return 影响行数
     */
    @Override
    public int batchDelete(String programVersion) {
        return programSourceMapper.batchDelete(programVersion);
    }
}
